package user;

import java.lang.reflect.Method;

import anotaciones.Test;

public class RunTests {
	public static void main(String[] args) throws Exception {
		int passed =0, falied = 0;
		
		for (Method m : Class.forName(args[0]).getMethods()) {//"user.Foo"
			if(m.isAnnotationPresent(Test.class)){
				try{
					m.invoke(null);
					passed++;
				}catch (Throwable ex) {
					// TODO: handle exception
					System.out.printf("Test %s falied: %s %n",m,ex.getCause());
					falied++;
				}
			}
		}
		
		System.out.printf("Passed: %d, Falied %d%n",passed,falied);
	}
}
